﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Topshelf.Configuration.Dsl;
using Topshelf;
using log4net;
using log4net.Appender;

namespace HgRemoteServer
{
	class App
	{
		static void Main(string[] args)
		{
			log4net.Config.XmlConfigurator.Configure();

			var cfg = RunnerConfigurator.New(c =>
			{
				c.ConfigureService<Service>(s =>
				{
					s.Named("HgRemoteServer");
					s.HowToBuildService(x => new Service());
					s.WhenStarted(svc => svc.Start());
					s.WhenStopped(svc => svc.Stop());
				});
				c.SetDescription("Runs the HgRemoteServer Service.");
				c.SetDisplayName("HgRemoteServer");
				c.SetServiceName("HgRemoteServer");
			});
			Runner.Host(cfg, args);
		}
	}
}
